//
//  MethodNotImplementedException.m
//  Oos4ios
//
//  Created by Pablo Gonzalez on 2/24/11.
//  Copyright 2011 11870.com. All rights reserved.
//

#import "MethodNotImplementedException.h"


@implementation MethodNotImplementedException

+ (void) raiseForMethod:(NSString *)method inObject:(id)object
{
	MethodNotImplementedException *exception = 
	[[MethodNotImplementedException alloc] initWithMethod:method inObject:object];
	[exception raise];
}

+ (void) raiseForSelector:(SEL)selector inObject:(id)object
{
	[MethodNotImplementedException raiseForMethod: NSStringFromSelector(selector) inObject:object];
}

- (id) initWithMethod:(NSString *)method inObject:(id)object
{
	NSString *className = NSStringFromClass([object class]);
	NSDictionary *aUserInfo = [NSDictionary dictionaryWithObjectsAndKeys:
							   method,		@"method",
							   className,	@"className",
							   nil];
	NSString *reason = [NSString stringWithFormat: @"Method: %@ in Class: %@ was not implemented", method, className];
	self = [super initWithName:@"MethodNotImplementedException" 
						reason:reason 
					  userInfo:aUserInfo];
	return self;
}



@end
